<form class="layui-form" lay-filter="LAY-app-project-issue-form" id="LAY-app-project-issue-form">
    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <input type="radio" name="type" value="0" title="任务" checked="" lay-filter="issue_type">
            <input type="radio" name="type" value="1" title="需求" lay-filter="issue_type">
            <input type="radio" name="type" value="2" title="缺陷" lay-filter="issue_type">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="title" value="{{ d.params.title || '' }}" lay-verify="required"
                       placeholder="请输入..." autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">进度</label>
        <div class="layui-input-inline">
            <input type="number" name="progress" lay-verify="required" value="0" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <select name="status">
                <option value="0">代办的</option>
                <option value="1">进行中</option>
                <option value="2">已完成</option>
                <option value="3">已拒绝</option>
                <option value="4">已确认</option>
                <option value="5">设计中</option>
                <option value="6">开发中</option>
                <option value="7">已验收</option>
                <option value="8">修复中</option>
                <option value="9">已取消</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">负责人</label>
        <div class="layui-input-inline">
            <select name="accept">
                <option value="">请选择负责人</option>
                <option value="1">admin</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开始日期</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="laydate-start" placeholder="开始日期">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">截止日期</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="laydate-end" placeholder="截止日期">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">预计工时</label>
        <div class="layui-input-inline">
            <input type="number" name="hour" class="layui-input" placeholder="1">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">内容</label>
        <div class="layui-input-block">
            <script type="text/html" template>
                <textarea name="content" placeholder="请输入" class="layui-textarea">{{ d.params.content || '' }}</textarea>
            </script>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="LAY-app-project-issue-submit" value="确认" class="layui-btn">
        </div>
    </div>
</form>
<script>
    layui.use(['laydate'], function(){
        var laydate = layui.laydate;

        //开始日期
        var insStart = laydate.render({
            elem: '#laydate-start'
            ,min: 0
            ,done: function(value, date){
                //更新结束日期的最小日期
                insEnd.config.min = lay.extend({}, date, {
                    month: date.month - 1
                });

                //自动弹出结束日期的选择器
                insEnd.config.elem[0].focus();
            }
        });

        //结束日期
        var insEnd = laydate.render({
            elem: '#laydate-end'
            ,min: 0
            ,done: function(value, date){
                //更新开始日期的最大日期
                insStart.config.max = lay.extend({}, date, {
                    month: date.month - 1
                });
            }
        });
    });
</script>